package com.situ.crm.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import com.situ.crm.common.mapper.BaseMapper;
import com.situ.crm.entity.RoleMenu;

public interface RoleMenuMapper extends BaseMapper<RoleMenu>{

	@Delete("delete from role_menu where role_id = #{roleId}")
	int deleteByRoleId(Integer roleId);
	
	@Select("SELECT distinct menu_id from role_menu left join user_role on user_role.role_id = role_menu.role_id where user_role.user_id = #{id}")
	List<Integer> selectMenuByUserId(Integer id);

}
